using Catastrophe.Common.AttributeEx;
using HslCommunicationEx.OpcUa.Client.SieCnc;


namespace HslCommunicationEx.OpcUa.SieCnc
{
	/// <summary>
	/// 刀具信息
	/// </summary>
	public class OpcUaToolBaseEntity : MultiToolDataEntity
	{
		[ComOpcUaData("/Tool/Data/toolInMag[u{toolAreaNo},{tNo}]", "刀库", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int ToolInMag { get; set; }

		public string ToolInMagDescribe => this.ToolInMag switch
		{
			9998 => "主轴刀库(9998)", 
			1 => "刀具列表(1)", 
			0 => "缓存刀库(0)", 
			_ => this.ToolInMag.ToString(), 
		};

		[ComOpcUaData("/Tool/Data/toolIdent[u{toolAreaNo},{tNo}]", "刀具名称", OprTypeEnum.Read, AllowOprEnum.ReadAndWrite, false)]
		public string ToolIdent { get; set; }

		[ComOpcUaData("/Tool/Data/toolInPlace[u{toolAreaNo},{tNo}]", "刀具存储刀位号", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int ToolInPlace { get; set; }

		[ComOpcUaData("/Tool/Data/duploNo[u{toolAreaNo},{tNo}]", "姊妹刀号", OprTypeEnum.Read, AllowOprEnum.ReadAndWrite, false)]
		public int DuploNo { get; set; }

		[ComOpcUaData("/Tool/Data/numCuttEdges[u{toolAreaNo},{tNo}]", "刀沿数量", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int NumCuttEdges { get; set; }

		[ComOpcUaData("/Tool/Data/toolState[u{toolAreaNo},{tNo}]", "刀具状态", OprTypeEnum.Read, AllowOprEnum.ReadAndWrite, false)]
		public int ToolState { get; set; }

		[ComOpcUaData("/Tool/Data/toolMon[u{toolAreaNo},{tNo}]", "监控类型", OprTypeEnum.Read, AllowOprEnum.ReadAndWrite, false)]
		public int ToolMon { get; set; }

		[ComOpcUaData("/Tool/Data/toolplace_spec[u{toolAreaNo},{tNo}]", "刀具的刀库位置类型", OprTypeEnum.Read, AllowOprEnum.ReadAndWrite, false)]
		public int ToolPlaceSpec { get; set; }

		[ComOpcUaData("/Tool/Data/toolsize_left[u{toolAreaNo},{tNo}]", "左侧尺寸", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int LeftSize { get; set; }

		[ComOpcUaData("/Tool/Data/toolsize_right[u{toolAreaNo},{tNo}]", "右侧尺寸", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int RightSize { get; set; }

		[ComOpcUaData("/Tool/Data/toolsize_upper[u{toolAreaNo},{tNo}]", "上侧尺寸", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int TopSize { get; set; }

		[ComOpcUaData("/Tool/Data/toolsize_down[u{toolAreaNo},{tNo}]", "下侧尺寸", OprTypeEnum.Read, AllowOprEnum.ReadOnly, false)]
		public int BottomSize { get; set; }

		public bool IsEmpty { get; set; }
	}
}
